#include <stdio.h>

int main(void) {
  int n;
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    int a, b, c, d;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    if ((c <= a && a <= d) || (c <= b && b <= d) || (a <= c && d <= b)) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
